<!DOCTYPE html>
<html>
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title><?php echo isset($title) ? $title : '';?></title>
      <!-- 设置缩放 -->
      <meta name="viewport" content="minimal-ui,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
      <!-- IOS中禁用将数字识别为电话号码/忽略Android平台中对邮箱地址的识别 -->
      <meta name="format-detection" content="telephone=no" />
      <!-- windows phone 点击无高光 -->
      <meta name="msapplication-tap-highlight" content="no" />
      <!-- icon -->
      <link rel="shortcut icon" href="<?php echo ADMIN_ICO_PIC;?>" type="image/x-icon"/>
      <!-- css -->
      <link rel="stylesheet" type="text/css" href="<?php echo SYS_LINK;?>admin/css/content.css?v=<?php echo V_CSSJS;?>" />

      <style>
          #sqlFormBox{width:100%;}
          #sqlFormBox form textarea{width:calc(100% - 22px);height:150px;border:1px solid #ccc;padding:10px;}
          #sqlFormBox form .btn_base{position: absolute;top: 45px;right: 20px;}
          #sqlFormBox .db_box{margin:15px 0 15px 0;border-top:2px solid #ddb091;padding:15px 0 15px 0;}
      </style>
  </head>
<body class="noselect">
<?php
$userLevel = isset($userLevel) ? $userLevel : 0;
$powerInfo = isset($powerInfo) ? $powerInfo : powerInfoListDeVal();
?>
<div class="con_box">
    <!-- tab导航 -->
    <?php include SYS_PATH.SYS_APP_PATH.'/admin/views/admin_system/navtab.php';?>
	<!--  -->
    <div id="sqlFormBox">
        <form action="<?php echo SYS_URL_PATH('admin_system_dbdo');?>" method="post">
            <input type="hidden" value="Y" name="subFlag">
            <input type="submit" value="go" class="btn_base btn_back_sides">
            <textarea name="sqlcode"><?php echo $sqlcode;?></textarea>
        </form>
        <div class="db_box">
            <?php
            if(!is_array($result)){
                echo $result;
            }else if(empty($result)) {
                echo '↑↑↑↑↑↑';
            }else{
                $keys = end($result);
            ?>
            <table class="table_th_td">
                <tr class="weight400">
                    <?php
                    foreach($keys as $k=>$v){
                        echo "<th title='$k'>$k</th>";
                    }
                    ?>
                </tr>

                <?php
                foreach($result as $v){
                    echo '<tr>';
                        foreach($v as $key=>$val){
                            echo "<td title='$val'>$val</td>";
                        }
                    echo '</tr>';
                }
                ?>
            </table>
            <?php } ?>
        </div>
    </div>
</div>

</body>
<script language="javascript">
  var http_url = '<?php echo SYS_HOST;?>';
    var http_link = '<?php echo SYS_LINK;?>';
  var cssjsv = '<?php echo V_CSSJS;?>';
  var http_fix = '<?php echo SYS_URL_FIX;?>';
</script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/jquery.min.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/skin.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript" src="<?php echo SYS_LINK;?>admin/js/common.js?v=<?php echo V_CSSJS;?>"></script>
<script type="text/javascript">file_load('info');</script>
<script language="javascript">
    // 页面加载完毕
    window.onload = function () {

    }
    // jquery
    $(function(){

    })

</script>
</html>